import React from 'react'
import { ComponentMeta } from "@storybook/react";

import { Select } from './Select';

export default {
    title: 'Wavexk/Select',
    component: Select,
    argTypes: {

        options: {
            type: 'string',
            description: 'the Options of this Select',
            table: {
                type: {
                    summary: 'string',
                },
            },
            control: {
                type: 'inline-radio',
                options: ['horizontal', 'vertical']
            },
        },
        defaultSelectedOptions: {
            type: Array,
            description: 'Default Selected Options',
            table: {
                type: {
                    summary: "Array",
                },
                defaultValue: {
                    summary: "[]"
                },
            },
        },
        onChange: {
            description: "onChange event",
            action: 'changed'
        }
    }
} as ComponentMeta<typeof Select>;

export const Default = (args: any) => {
    return <Select 
            options={['nihao', 'nihao2', 'nihao3', 
                'disabled', 'nihao5']}
            onChange={values => console.log(values)}
            defaultSelectedOptions={['nihao', 'nihao2']} 
        />
}